package com.wolf;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author marin
 * @version 1.0
 * @date 2025/8/21 09:41
 * @desc
 */
@Controller
public class ServletController {

    @RequestMapping("/servlet")
    public String servlet(HttpServletRequest request){
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        System.out.println("username:"+username +" password:"+password);
        return "success";
    }

    @RequestMapping("/servlet2")
    public String servlet2(String username,String password){
        System.out.println("username:"+username +" password:"+password);
        return "success";
    }

    @RequestMapping("/servlet3")
    public String servlet3(@RequestParam String username, @RequestParam("password") String pwd){
        System.out.println("username:"+username +" password:"+pwd);
        return "success";
    }
}
